package com.ipay.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.ipay.dao.PayorderDao;
import com.ipay.entity.PayorderEntity;
import com.ipay.service.PayorderService;

@Service("payorderService")
public class PayorderServiceImpl implements PayorderService {
	@Autowired
	private PayorderDao payorderDao;

	@Override
	public PayorderEntity queryObject(String id) {
		return payorderDao.queryObject(id);
	}

	@Override
	public List<PayorderEntity> queryList(Map<String, Object> map) {
		return payorderDao.queryList(map);
	}

	@Override
	public int queryTotal(Map<String, Object> map) {
		return payorderDao.queryTotal(map);
	}

	@Override
	public void save(PayorderEntity payorder) {
		payorderDao.save(payorder);
	}

	@Override
	public void update(PayorderEntity payorder) {
		payorderDao.update(payorder);
	}

	@Override
	public void delete(String id) {
		payorderDao.delete(id);
	}

	@Override
	public void deleteBatch(String[] ids) {
		payorderDao.deleteBatch(ids);
	}

	public PayorderEntity queryByOderNo(String orderNo) {
		return payorderDao.queryByOderNo(orderNo);
	}

	public PayorderEntity queryByRelationOrder(String orderNo) {
		// 支付订单
		PayorderEntity payOrder = payorderDao.queryByOderNo(orderNo);
		return payorderDao.queryByRelationOrder(payOrder.getId());
	}

}
